home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Software Contest 3
/
FM Towns Software Contest 3.iso
/
exp
/
video_t
/
no1
/
c_sorse
/
tiff2.c
< prev
next >
Wrap
Text File
|
1994-01-07
|
8KB
|
342 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
#include <file_dlg.h>
int Dialog_tiff = -1 ;
int DButton_tiff = -1 ;
int DButton_009f = -1 ;
int DButton_00a1 = -1 ;
int _001Message_00a5 = -1 ;
int _002Message_00a5 = -1 ;
int Message_00a5 = -1 ;
int Message_00a3 = -1 ;
int _001Message_00a3 = -1 ;
int TIcon_tiff[2] = -1 ;
int _002Message_00a3 = -1 ;
int _003Message_00a3 = -1 ;
int Text_009b = -1 ;
int DButton_00aa = -1 ;
int _001DButton_00aa = -1 ;
int _002DButton_00aa = -1 ;
int Message_00bd = -1 ;
int _001Message_00bd = -1 ;
int _002Message_00bd = -1 ;
int DButton_10c3 = -1 ;
int Message_00c5 = -1 ;
int radiotiff = 0 ;
extern int backid ;
extern int Dia_edit ;
extern int Dialog_menu ;
extern int Text ;
extern void tiff();
extern char *guiEgbPtr ;
extern char *getgraph;
extern void memory_error();
extern int menud;
/* initDataTIFF:DButton_00aa:MJ_DBUTTONL40の呼び出し関数 */
int tiff_past(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Text_009b, MM_PASTE, 0) ;
return NOERR ;
}
/* initDataTIFF:_001DButton_00aa:MJ_DBUTTONL40の呼び出し関数 */
int tiff_del(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Text_009b, MM_CUT, 0) ;
return NOERR ;
}
/* initDataTIFF:_002DButton_00aa:MJ_DBUTTONL40の呼び出し関数 */
int tiff_copy(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Text_009b, MM_COPY, 0) ;
return NOERR ;
}
/* initDataTIFF:DButton_10c3:MJ_DBUTTONL40の呼び出し関数 */
int tiff_fail(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
unsigned int MSlctCnt;
unsigned int InfSw;
int i;
int BaseID;
int Stat;
int Atr;
int BtnID[3];
int MsgID[3];
FRAME Frm;
char *data;
char pathname[400];
static char *ExtStr[]={"*.TIF",NULL};
static FONTTYPE type={1,12,12,MS_NONEL40,0,0};
/* メニューを選択不可とします。 */
MTL_setAtrObj(Dialog_tiff, MS_DSPONLYL40) ;
FDG_SaveCurDir();
FDG_InitFileDlg();
FDG_SetTitle("画像・複数選択","選択","取消");
FDG_GetFrame(&Frm);
BaseID=FDG_GetMainID();
/*InfSw = FDG_MSLCT;*/
Frm.lupx+=20;
Frm.lupy+=20;
FDG_SetFrame(Frm);
Stat=FDG_DspFileDlg(MMI_GetBaseObj(),FDG_MSLCT,NULL,ExtStr,&MSlctCnt);
if(Stat)
{
for(i=0;i<MSlctCnt;i++)
{
FDG_GetPathName(pathname,&Atr,i);
MMI_SendMessage(Text_009b,MM_SETTEXT,3,pathname,256,TRUE) ;
MMI_SendMessage(Text_009b,MM_SETTEXT,3,"\n",5,TRUE) ;
}
}
FDG_FreeFileDlg();
FDG_RecovCurDir();
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_tiff, ~MS_DSPONLYL40) ;
MMI_SendMessage(Text_009b, MM_ERASE, 0) ;
MMI_SendMessage(Text_009b, MM_WAKE, 0) ;
MMI_SendMessage(Text_009b, MM_SHOW, 0) ;
return NOERR ;
}
int count;
extern char wdata2[100][160]; /* セーブTIFF データ */
extern char wzahyo[100][30]; /* セーブTIFF データ */
/* initDataTIFF:DButton_tiff:MJ_DBUTTONL40の呼び出し関数 */
int tiff_on(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int i,iii;
for (iii = 0 ; iii < 2 ; iii++)
{
if (TIcon_tiff[iii] == radiotiff) break ;
}
if(iii==1)
{
MMI_SendMessage(Text,MM_SETTEXT,3,"/GMODE 6",100,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,"\n",5,TRUE) ;
}
if(count!=0)
{
/* メニューを選択可とします。 */
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
for(i=0;i<count;i++)
{
MMI_SendMessage(Text,MM_SETTEXT,3,wdata2[i],400,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,"\n",5,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,wzahyo[i],400,TRUE) ;
MMI_SendMessage(Text,MM_SETTEXT,3,"\n",5,TRUE) ;
}
MMI_SendMessage(Dialog_tiff,MM_ERASE,0) ;
MMI_SendMessage(Dialog_tiff,MM_DETACH,0) ;
MMI_SendMessage(Text, MM_ERASE, 0) ;
MMI_SendMessage(Text, MM_SHOW, 0) ;
MMI_SendMessage(Text, MM_WAKE, 0) ;
}
return NOERR ;
}
extern char *pwork;
char *gwork; /* グラフィックデータのポンイタ*/
/* initDataTIFF:DButton_009f:MJ_DBUTTONL40の呼び出し関数 */
int tiff_kaku(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int i,ii,iii;
char tensou[300];
TEHandle *gte;
int line;
char *tdata;
/* メニューを選択不可とします。 */
MTL_setAtrObj(Dialog_tiff, MS_DSPONLYL40) ;
if(( tdata = (char *)TL_malloc(10*1024+8)+4)==NULL)
{
memory_error();
return -1;
}
if((gwork = (char *)TL_malloc( 512*1024+8)+4)==NULL)
{
TL_free(tdata-4);
memory_error();
return -1;
}
if((getgraph = (char *)TL_malloc( 512*1024+8)+4)==NULL)
{
TL_free(gwork-4);
TL_free(tdata-4);
memory_error();
return -1;
} /* グラフイック取り込み */
MMI_SendMessage(Text_009b, MM_GETTEXT, 3, tdata,10*1024,0) ;
MG_pushEgbWork(guiEgbPtr,&pwork);
for (iii = 0 ; iii < 2 ; iii++)
{
if (TIcon_tiff[iii] == radiotiff) break ;
}
MMI_SendMessage(Text_009b,MM_GETTEHANDLE, 1, >e);
TE_GetTextLine2(gte,&line);
menud = -1;
if(iii==1) gamen6();
count=0;
int err;
for(ii=0;ii<10*1024;ii++)
{
for(i=0;i<240;i++)
{
tensou[i]= tdata[ii];
if(( tdata[ii]==0x0d)||( tdata[ii]==0x00))
{
tensou[i]='\0';
ii++;
break;
}
ii++;
}
err=_access(tensou,0);
if(err==0)
{
tiff(tensou,count);
count++;
wait();
}
if( tdata[ii]==0x00) break;
}
TL_free(getgraph-4);
TL_free(gwork-4);
TL_free(tdata-4);
gamen2();
MG_popEgbWork(guiEgbPtr,pwork);
WINCLIP *pwclp ;
FRAME fr ;
fr.lupx = 0 ;
fr.lupy = 0 ;
fr.rdwx = 639 ;
fr.rdwy = 479 ;
pwclp = WIN_getClipMemory(&fr, NULL) ;
MMI_SendMessage(MMI_GetBaseObj(), MM_UPDATE, 1, pwclp) ;
WIN_freeClipMemory(pwclp) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_tiff, ~MS_DSPONLYL40) ;
return NOERR ;
}
/* initDataTIFF:DButton_00a1:MJ_DBUTTONL40の呼び出し関数 */
int tiff_off(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Dialog_tiff,MM_ERASE,0) ;
MMI_SendMessage(Dialog_tiff,MM_DETACH,0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(Dia_edit, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
return NOERR ;
}
/* initDataTIFF:TIcon_tiff[0]:MJ_TICONL40の呼び出し関数 */
/* initDataTIFF:TIcon_tiff[1]:MJ_TICONL40の呼び出し関数 */
int tiff_check(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
/* 現在選択状態にあるボタンを非選択状態にし、選択可にします */
MTL_resetFlagObj(radiotiff,~(MS_UNSELECT | MS_TOGGLE)) ;
MMI_SendMessage(radiotiff, MM_SHOW, 0) ;
/* 画面選択フラグを更新します */
radiotiff = kobj ;
/* 呼び出し元トグルボタンを選択状態にし、選択不可にします */
MTL_setFlagObj(kobj, MS_UNSELECT | MS_TOGGLE) ;
MMI_SendMessage(kobj, MM_SHOW, 0) ;
return NOERR ;
}
int l_tiff()
{
/* 背景を選択不可とします。*/
MTL_setAtrObj(backid, MS_DSPONLYL40) ;
MTL_setAtrObj(Dialog_menu, MS_DSPONLYL40) ;
MTL_setAtrObj(Dia_edit, MS_DSPONLYL40) ;
MMI_SendMessage(Dialog_tiff,MM_ATTACH,1,MMI_GetBaseObj()) ;
MMI_SendMessage(Dialog_tiff, MM_SHOW, 0) ;
MMI_SendMessage(Text_009b, MM_SHOW, 0) ;
MMI_SendMessage(Text_009b, MM_WAKE, 0) ;
return NOERR ;
}